主题
移除OLA图像 - RemoveOlaImage
函数简介
从OLA数据库中移除指定目录和文件名的单个图像数据。
接口名称
RemoveOlaImageDLL调用
cpp
int RemoveOlaImage(long ola, const long db, string dir, string fileName);参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整型数 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成 |
| db | 长整型数 | 数据库连接句柄,由 OpenDatabase 接口生成 |
| dir | 字符串 | 图像文件在数据库中的目录路径 |
| fileName | 字符串 | 图像文件名 |
示例
SDK 调用
cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
int ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt");
if (ret == 1) {
// 操作成功
}csharp
using OLAPlug;
var ola = new OLAPlugServer();
int ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt");
if (ret == 1)
{
// 操作成功
}python
from OLAPlugServer import OLAPlugServer
ola = OLAPlugServer()
ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt")
if ret == 1:
pass # 操作成功java
import com.olaplug.OLAPlugServer;
OLAPlugServer ola = new OLAPlugServer();
int ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt");
if (ret == 1) {
// 操作成功
}cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt")
if(ret == 1) {
// 操作成功
}vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt")
If ret = 1 Then
' 操作成功
End Iftext
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.RemoveOlaImage(0, “value”, “C:\\test.txt”)
.如果真 (ret = 1)
' 操作成功
.如果真结束aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt");
if(ret == 1){
// 操作成功
}text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt")
如果真 (ret = 1)
{
// 操作成功
}cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
int32_t ret = ola.RemoveOlaImage(0, "value", "C:\\test.txt");
if (ret == 1) {
// 操作成功
}原生 DLL 调用
cpp
long instance = CreateCOLAPlugInterFace();
RemoveOlaImage(instance, 0, "value", "C:\\test.txt");csharp
using System.Runtime.InteropServices;
using System.Text;
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long CreateCOLAPlugInterFace();
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int RemoveOlaImage(long ola, long db, string dir, string fileName);
long instance = CreateCOLAPlugInterFace();
RemoveOlaImage(instance, 0, "value", "C:\\test.txt");python
from ctypes import CDLL, c_int, c_int64, create_string_buffer
ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
ola.RemoveOlaImage(instance, 0, "value", "C:\\test.txt")返回值
操作结果。成功返回 1,失败返回 0。
注意事项
- 适用于删除单个图像数据的场景。
- 如果移除失败,可通过 GetDatabaseError 获取详细错误信息。
- 确保目录路径和文件名正确且图像数据存在于数据库中。
